
#include "common.h"

QueueHandle_t serialMessageQueue;


void print_all_tasks_info()
{
    char taskList[512];
    vTaskList(taskList);
    printf("任务列表及堆栈使用情况:\n");
    printf("名称          状态 优先级 剩余堆栈 任务句柄\n");
    printf("%s\n", taskList);
}

void print_heap_info(const char* tag) {
    uint32_t free_heap = esp_get_free_heap_size();
    uint32_t min_free_heap = esp_get_minimum_free_heap_size();
    ESP_LOGI(tag, "当前可用堆内存: %ld 字节", free_heap);
    ESP_LOGI(tag, "历史最小可用堆内存: %ld 字节", min_free_heap);
}

void initSerialPortQueue(){

    serialMessageQueue=xQueueCreate(10,sizeof(MQTT_MESSAGE));
    ESP_LOGI(COMMON_TAG,"serialMessageQueue Init Success!!!");
}

 
